{% extends 'base.html' %}
{% load staticfiles %}
{% load i18n %}

{% block head %}
  <link href="{% static 'css/cover.css' %}" rel="stylesheet">
{% endblock head %}

{% block body %}
  <a href="https://github.com/vitorfs/bootcamp"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
  <div class="cover">
    <h1 class="logo">Bootcamp</h1>
    {% if form.non_field_errors %}
      {% for error in form.non_field_errors %}
        <div class="alert alert-danger alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          {{ error }}
        </div>
      {% endfor %}
    {% endif %}
    <div class="login">
      <h2>{% trans 'Log in' %}</h2>
      <form method="post" action="{% url 'login' %}" role="form">
        {% csrf_token %}
        <div class="form-group{% if form.username.errors %} has-error{% endif %}">
          <label for="username">{% trans 'Username' %}</label>
          <input type="text" class="form-control" id="username" name="username">
          {% for error in form.username.errors %}
            <label class="control-label">{{ error }}</label>
          {% endfor %}
        </div>
        <div class="form-group{% if form.password.errors %} has-error{% endif %}">
          <label for="password">{% trans 'Password' %}</label>
          <input type="password" class="form-control" id="password" name="password">
          {% for error in form.password.errors %}
            <label class="control-label">{{ error }}</label>
          {% endfor %}
        </div>
        <div class="form-group">
          <button type="submit" class="btn btn-default">{% trans 'Log in' %}</button>
          <a href="{% url 'signup' %}" class="btn btn-link">{% trans 'Sign up for Bootcamp' %}</a>
        </div>
      </form>
    </div>
  </div>
{% endblock body %}
